<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>12_数组的增-中间增</title>
    </head>
    <body>
        <script>
            //         0 1 2 3 4 5
            // var arr = [1,2,3,4,5];

            // arr[5] = arr[4];
            // arr[4] = arr[3];
            // arr[3] = arr[2];
            // arr[2] = arr[1];

            // arr[1] = 666;
            // console.log(arr);

            var arr = [1,2,3,4,5];

            for(var i = arr.length - 1; i >= 1; i--){
                arr[i+1] = arr[i];
            }

            arr[1] = 666;
            console.log(arr);



        </script>
    </body>
</html>